<template>
  <div class="base-container">
    <div style="position: fixed;width: 20%;height: 100%;overflow: scroll;padding-bottom: 100px">
      <t-loading size="small" :loading="dataLoading" showOverlay>
        <div>
          <t-tree line ref="tree" :keys="{value: 'id',label:'name'}" :actived="actived" expand-all
                  :data="TreeReviewTeamData" @active="onTreeActive" activable hover
                  transition>
            <template #label="{ node }">
              {{ node.data.name }}<span v-if="!['1'].includes(node.data.reviewMenuType)   && node.data.projectCount" >(<span style="color: #176eff">{{ node.data.projectCount }}</span>)</span>
            </template>
            <template #operations="{ node }">
              <t-button v-if="['1'].includes(node.data.reviewMenuType)" size="small" variant="text" @click="dialog.header = '添加组';
              dialog.objId = 0;
              dialog.parentId = node.data.id;
              dialog.open_add_edit = true;">
                <t-icon name="add" slot="icon"/>
              </t-button>
              <t-button v-if="node.data.name!=='评审分组体系'" size="small" variant="text" @click="dialog.header = '编辑组';
              dialog.objId = node.data.id;
              dialog.parentId = 0;
              dialog.open_add_edit = true;">
                <t-icon name="edit-1" slot="icon"/>
              </t-button>
              <t-popconfirm v-if="node.data.name!=='评审分组体系'" @confirm="removeNode(node)" theme="warning"
                            content="确认删除分组吗">
                <t-button size="small" variant="text">
                  <t-icon name="delete" slot="icon"/>
                </t-button>
              </t-popconfirm>
            </template>
          </t-tree>
        </div>
      </t-loading>
    </div>

      <!-- 右侧内容 -->
    <div style="margin-left: 24%;height: 100%;">

    <t-loading size="small" :loading="baseLoading" showOverlay>
          <t-card>
            <div>
              <template><div :style="{ width: '200px' }">
                <t-divider>基本信息</t-divider>
              </div>
              </template>
              <t-form labelWidth="150px" :data="formData" ref="form" :colon="true">
                <t-row style="row-gap: 10px">
                  <t-col :span="6">
                    <t-form-item label="分组名" name="name">
                      {{ formData.name }}
                    </t-form-item>
                  </t-col>

                  <t-col :span="6">
                    <t-form-item label="创新类别" name="innovationCategory">
                      {{formData.innovationCategory  | filterByDict(dict.type.innovation_category)}}
                    </t-form-item>
                  </t-col>
                  <t-col :span="6">
                    <t-form-item label="评审业务类型" name="reviewType">
                      {{ formData.reviewType | filterByDict(dict.type.wcx_review_type) }}
                    </t-form-item>
                  </t-col>
                  <t-col :span="6">
                    <t-form-item label="指标体系" name="indexId">
                      {{ formData.indexId | filterByDict(dataOptions) }}
                      <t-button v-if="formData.indexId"
                                @click="dialog.header='评审指标体系详情';dialog.objId=formData.indexId;dialog.open_review_standard=true"
                                variant="text" class="t-button-link">
                        <t-icon name="info-circle" slot="icon"/>
                        详情
                      </t-button>
                    </t-form-item>
                  </t-col>

                  <t-col :span="6">
                    <t-form-item label="专家评审开始时间" name="startReviewDate">
                      {{ formData.startReviewDate }}
                    </t-form-item>
                  </t-col>
                  <t-col :span="6">
                    <t-form-item label="专家评审截止时间" name="endReviewDate">
                      {{ formData.endReviewDate }}
                    </t-form-item>
                  </t-col>
                  <t-col :span="6">
                    <t-form-item label="评审会议时间" name="reviewMeetingDate">
                      {{ formData.reviewMeetingDate }}
                    </t-form-item>
                  </t-col>
                  <t-col :span="6">
                    <t-form-item label="分组说明" name="note">
                      {{ formData.note }}
                      <!--                      <t-textarea style="width: 240px" disabled v-model="formData.note"></t-textarea>-->
                    </t-form-item>
                  </t-col>
                </t-row>
              </t-form>
              <t-divider></t-divider>
              <!-- 专家 -->
              <t-row>
                <t-col :span="6">
<!--                  <div class="btn-group-inline">-->
<!--                    <t-button :disabled="!formData.id"-->
<!--                              >-->
<!--                      导出评审信息-->
<!--                    </t-button>-->
<!--                    <t-button :disabled="!formData.id"-->
<!--                              >-->
<!--                      导出账户信息-->
<!--                    </t-button>-->
<!--                    &lt;!&ndash;                    <t-button :disabled="!formData.id" @click="handleGroupSms(formData.id)">专家短信邀请</t-button>&ndash;&gt;-->
<!--                  </div>-->
                </t-col>
                <t-col :span="6">
                  <div style="justify-content: flex-end" class="btn-group-inline">
                    <t-button :disabled="!formData.id" @click="selectInnovation">选择成果</t-button>
                    <t-tooltip v-if="innovationList.length<=0" content="请先选择成果">
                      <t-button :disabled="!formData.id">
                        抽取专家
                      </t-button>

                    </t-tooltip>
                    <t-button :disabled="!formData.id" v-else  @click="selectExpert('0')">抽取专家</t-button>
                    <!-- <t-tooltip v-if="innovationList.length<=0" content="请先选择成果">
                      <t-button :disabled="!formData.id">
                        抽取专家(规避单位)
                      </t-button>
                    </t-tooltip> -->
                      <!-- <t-button :disabled="!formData.id" v-else @click="selectExpert('1')">抽取专家(规避单位)</t-button> -->
                  </div>
                </t-col>
              </t-row>
              <div :style="{ width: '200px' }">
                <t-divider>本组微创新成果</t-divider>
              </div>
              <t-row>
                <t-table
                  rowKey="id"
                  :data="innovationList"
                  :columns="innovationColumns"
                  :bordered="true"
                  :hover="true"
                >
                  <template #[`innovationAwards.awardsLevel`]="{ row }">
                    {{ row.innovationAwards?.awardsLevel | filterByDict(dict.type.wcx_awards_level) }}
                  </template>
                  <template #[`innovations.name`]="{row}">
                    <t-link @click="dialog.objId=row.innovations.id;dialog.header=row.innovations.name;dialog.open_innovation_detail=true" hover="color" theme="primary">{{row.innovations.name}}</t-link>
                  </template>
                  <template #[`innovations.applicationField`]="{row}">
                    {{ row.innovations.applicationField | filterByDict(dict.type.application_field) }}
                  </template>
                  <template #[`innovations.innovationCategory`]="{row}">
                    {{ row.innovations.innovationCategory | filterByDict(dict.type.innovation_category) }}
                  </template>
                  <template #op="{row}">
                    <t-button  @click="dialog.objId=row.id;dialog.reviewType = row.reviewType;dialog.projectName=row.innovations.name;dialog.innovationId=row.innovations.id;dialog.open_project_approval=true;"  size="small" variant="text"
                               class="t-button-link">
                      <t-icon name="edit-1" slot="icon"/>
                      评奖
                    </t-button>
                    <t-tooltip v-if="expertList.length<=0" content="请先抽取专家">
                      <t-button  size="small" variant="text"
                                   class="t-button-link">
                        <t-icon name="root-list" slot="icon"/>
                        专家评审详情
                      </t-button>
                    </t-tooltip>
                    <t-button  v-else  @click="dialog.objId=row.innovations.id;dialog.teamId=formData.id;dialog.projectName=row.innovations.name;dialog.open_review_list=true" size="small" variant="text"
                               class="t-button-link">
                      <t-icon name="root-list" slot="icon"/>
                      专家评审详情
                    </t-button>

                    <!-- v-if="[null,''].includes(row.projectStatus)" -->
<!--                    <t-button  @click="dialog.objId=row.id;dialog.projectName=row.innovations.name;dialog.innovationId=row.innovations.id;dialog.open_project_approval=true;"  size="small" variant="text"-->
<!--                               class="t-button-link">-->
<!--                      <t-icon name="check-circle" slot="icon"/>-->
<!--                      评审判定-->
<!--                    </t-button>-->
                    <t-button @click="dialog.header=row.innovations.name;dialog.objId=row.innovations.id;dialog.editOpen=false;dialog.open_detail=true" size="small" variant="text" class="t-button-link">
                      <t-icon name="info-circle" slot="icon"/>
                      推荐详情
                    </t-button>
                    <t-button theme="danger"  @click="teamInnovationDel(row.id)" size="small" variant="text"
                               class="t-button-link">
                      <t-icon name="delete" slot="icon"/>
                      删除
                    </t-button>
                  </template>
                  <template #projectStatus="{row}">
                      <t-tag theme="success" v-if="row.projectStatus==='1'">
                        是
                      </t-tag>
                      <t-tag theme="danger" v-else-if="row.projectStatus==='0'">
                        否
                      </t-tag>
                      <t-tag theme="warning" v-else>
                        未提交
                      </t-tag>
                  </template>
                </t-table>
              </t-row>

              <!-- 本组评审专家 -->

                  <div :style="{ width: '200px' }">
                    <t-divider>本组评审专家</t-divider>
                  </div>
                  <div class="btn-group-inline">
<!--                    <t-button-->
<!--                      :disabled="!formData.id"-->
<!--                      @click="onFP"-->
<!--                    >-->
<!--                      随机分配成果-->
<!--                    </t-button>-->
<!--                    <t-button-->
<!--                      @click="onResetFP"-->
<!--                      :disabled="!formData.id"-->
<!--                    >-->
<!--                      重置已分配成果-->
<!--                    </t-button>-->
<!--                    <t-button :disabled="!formData.id"-->
<!--                              @click="dialog.formData=formData;dialog.sendType=1;dialog.open_sms_template=true">本组专家短信邀请-->
<!--                    </t-button>-->
                    <!--                    <t-button :disabled="!formData.id" @click="handleGroupSms(formData.id)">专家短信邀请</t-button>-->
                  </div>
                  <t-table
                    rowKey="id"
                    :data="expertList"
                    :columns="expertColumns"
                    :bordered="true"
                    :hover="true"
                  >
                    <template #[`experts.sysUser.nickName`]="{ row }">
                      <t-link  @click="dialog.objId=row.experts.id;dialog.idCard=row.experts.sysUser.idCard;dialog.header=row.experts.sysUser.nickName;dialog.open_expert_detail=true" hover="color" theme="primary"> {{ row.experts.sysUser.nickName }}</t-link>
                    </template>
                    <template #[`experts.sysUser.duty`]="{ row }">
                      <div v-if="['99999',''].includes(row.experts.sysUser?.profTit)">
                        {{ row.experts.sysUser?.duty }}
                      </div>
                      <div v-else>
                        <t-tooltip :content="getDuty(row.experts.sysUser?.duty, row.experts.sysUser?.profTit)">
                        <p class="duty-text">
                          {{ row.experts.sysUser?.duty }}/{{
                            row.experts.sysUser?.profTit | filterByDict(dict.type.prof_tit)
                          }}
                        </p>
                      </t-tooltip>
                      </div>
                    </template>
                    <template #[`experts.sysUser.education`]="{ row }">
                      {{
                        row.experts.sysUser?.education | filterByDict(dict.type.education)
                      }}/{{ row.experts.sysUser?.degree | filterByDict(dict.type.degree) }}
                    </template>
                    <!--                    <template #[`experts.sysUser.degree`]="{ row }">-->
                    <!--                      {{ row.experts.sysUser?.degree | filterByDict(dict.type.degree) }}-->
                    <!--                    </template>-->
                    <template #[`sendMsg`]="{ row }">
                      <t-tag v-if="row.sendMsg==='1'" theme="success" variant="light">发送成功</t-tag>
                      <t-tag v-else-if="row.sendMsg==='0'" theme="danger" variant="light">发送失败</t-tag>
                      <t-tag v-else theme="warning" variant="light">未发送</t-tag>
                      /
                      <t-tag v-if="row.joinType==='1'" theme="success" variant="light">参加</t-tag>
                      <t-tag v-else-if="row.joinType==='0'" theme="danger" variant="light">不参加</t-tag>
                      <t-tag v-else theme="warning" variant="light">未回复</t-tag>
                    </template>
                    <template #op="{row}">
                      <t-button
                        @click="dialog.formData=formData;dialog.objId=row.id;dialog.sendType=2;dialog.nickName=row.experts.sysUser.nickName;dialog.open_sms_template=true"
                        size="small" variant="text"
                        class="t-button-link">
                        <t-icon name="cloud" slot="icon"/>
                        短信邀请
                      </t-button>
                      <t-button theme="danger" @click="teamExpertDel(row.id)" size="small" variant="text"
                                class="t-button-link">
                        <t-icon name="delete" slot="icon"/>
                        删除
                      </t-button>
                    </template>
                  </t-table>
            </div>
          </t-card>
        </t-loading>

   </div>
    <!-- 添加分组  编辑分组 -->
    <add-edit-group @reload="getListReviewTeam()" @changeActived="changeActived" :header="dialog.header" :parentId="dialog.parentId"
                    :objId="dialog.objId" :visible.sync="dialog.open_add_edit" v-if="dialog.open_add_edit">
    </add-edit-group>
    <select-innovation header="选择成果"
                    @reload="teamInnovationGet"
                    :formData="formData" :visible.sync="dialog.open_select_innovation"
                    v-if="dialog.open_select_innovation">
    </select-innovation>
    <select-expert header="抽取专家"
                   @reload="teamExpertGet"
                   :formData="formData"
                   :isEvadeCompany="dialog.isEvadeCompany"
                   :visible.sync="dialog.open_select_expert" v-if="dialog.open_select_expert"></select-expert>
    <expert-review-list :teamId="dialog.teamId" :reviewType="formData.reviewType" :objId="dialog.objId" :projectName="dialog.projectName" :visible.sync="dialog.open_review_list"
                        v-if="dialog.open_review_list"></expert-review-list>
    <recommend-detail-dialog :editOpen="dialog.editOpen" :header="dialog.header" :objId="dialog.objId" :visible.sync="dialog.open_detail" v-if="dialog.open_detail"></recommend-detail-dialog>
<!--    <innovation-approval @reload="teamInnovationGet" :reviewType="formData.reviewType" :header="dialog.header" :projectName="dialog.projectName" :innovationId="dialog.innovationId" :objId="dialog.objId" :visible.sync="dialog.open_project_approval" v-if="dialog.open_project_approval"></innovation-approval>-->
    <innovation-award-approval @reload="teamInnovationGet" :reviewType="dialog.reviewType" :header="dialog.header" :projectName="dialog.projectName" :innovationId="dialog.innovationId" :objId="dialog.objId" :visible.sync="dialog.open_project_approval" v-if="dialog.open_project_approval"></innovation-award-approval>
    <add-edit-review-standard :editOpen="false" :objId="dialog.objId" :visible.sync="dialog.open_review_standard"
                              v-if="dialog.open_review_standard"></add-edit-review-standard>
    <expert-detail-dialog :header="dialog.header" :obj-id="dialog.objId" :id-card="dialog.idCard" :visible.sync="dialog.open_expert_detail"
                          v-if="dialog.open_expert_detail"></expert-detail-dialog>
    <innovation-detail-dialog :header="dialog.header" :objId="dialog.objId" :visible.sync="dialog.open_innovation_detail" v-if="dialog.open_innovation_detail"></innovation-detail-dialog>

    <expert-sms-template @reload="teamExpertGet" :nick-name="dialog.nickName" :form-data="dialog.formData"
                         :send-type="dialog.sendType" :obj-id="dialog.objId" :visible.sync="dialog.open_sms_template"
                         v-if="dialog.open_sms_template"></expert-sms-template>
  </div>
</template>

<script>
import addEditGroup from "./components/add-edit-group.vue";
import SelectInnovation from "./components/select-innovation.vue";
import SelectExpert from "./components/select-expert.vue";
// import InnovationApproval from "./components/innovation-approval.vue";
import AddEditReviewStandard from './components/add-edit-review-standard.vue'
import innovationDetailDialog from "../innovation/components/innovation-detail-dialog.vue";
import ExpertReviewList from "./components/expert-review-list.vue";
import RecommendDetailDialog from "../recommend/components/recommend-detail-dialog.vue";
import ExpertDetailDialog from "../../zjk/expert/components/expert-detail-dialog.vue";
import ExpertSmsTemplate from "./components/expert-sms-template.vue";
import InnovationAwardApproval from "./components/innovation-award-approval.vue";
import filters from "@/filters/index"

export default {
  name: "review-group",
  components: {
    addEditGroup,
    SelectExpert,
    SelectInnovation,
    ExpertReviewList,
    RecommendDetailDialog,
    // InnovationApproval,
    AddEditReviewStandard,
    ExpertDetailDialog,
    ExpertSmsTemplate,
    innovationDetailDialog,
    InnovationAwardApproval
  },
  dicts: ["innovation_category","prof_tit","duty","application_field", 'education', 'degree', 'wcx_review_type', 'wcx_awards_level'],
  data() {
    return {
      actived: [],
      dataOptions:[],
      innovationList: [],
      expertList: [],
      innovationColumns: [
        {colKey: 'innovations.name', title: '成果名称',align: "center"},
        {colKey: 'innovations.applicationProject', title: '应用项目',align: "center"},
        {colKey: 'innovations.applicationField', title: '应用领域',align: "center"},
        {colKey: 'innovations.innovationCategory', title: '创新类别',align: "center"},
        {colKey: 'innovations.leaderName', title: '负责人',align: "center"},
        {colKey: 'innovations.deptName', title: '工作单位',align: "center"},
        {colKey: 'sumScore', title: '评审平均分',align: "center"},
        {colKey: "innovationAwards.awardsLevel", title: "获奖等级", align: "center"},
        // {colKey: 'projectStatus', title: '是否通过',align: "center", width:120},
        // {colKey: 'project.attributeDeptName', title: '归口单位',align: "center", ellipsis: true},
        {
          colKey: 'op',
          title: '操作',
          align: "center",
        },
      ],
      expertColumns: [
        {colKey: 'experts.sysUser.nickName', title: '专家姓名', align: "center"},
        // {colKey: 'reviewCount', title: '已分配成果', align: "center"},
        {colKey: 'experts.age', title: '年龄', align: 'center', width: 80},
        {colKey: 'experts.sysUser.dept.deptName', title: '所在单位', align: "center", width: 180},
        {colKey: 'experts.sysUser.phonenumber', title: '手机号', align: "center", width: 130},
        {colKey: 'experts.sysUser.duty', title: '职务/职称', align: "center"},
        // { colKey: 'experts.declareDeptName', title: '部门', },
        {colKey: 'experts.recommendMajorName', title: '组别', align: "center", width: 120},
        // {colKey: 'experts.sysUser.majorName', title: '专业',align: "center"},
        {colKey: 'experts.sysUser.majorNowName', title: '现从事专业', align: "center"},
        {colKey: 'experts.sysUser.education', title: '学历/学位', align: "center"},
        // {colKey: 'experts.sysUser.degree', title: '学位',align: "center"},
        {colKey: 'sendMsg', title: '短信通知/是否参加', align: "center", width: 120},
        // {colKey: 'experts.joinType', title: '是否参加',align: "center"},
        // {colKey: 'experts.joinReviewTimes', title: '参与评审次数',align: "center"},
        // {colKey: 'experts.joinProjectTimes', title: '参与项目次数',align: "center"},

        // {colKey: 'experts.phoneNumber', title: '联系方式',align: "center"},
        {
          colKey: 'op',
          title: '操作',
          width: 130,
          align: "center",
        },
      ],
      visible: false,
      useActived: true,
      activeId: '',
      activeIds: [],
      TreeReviewTeamData: [],
      selectTreeTeamObj: {},
      dialog: {
        parentId: 0,
        objId: 0,
        teamId: 0,
        innovationId: 0,
        editOpen:false,
        open_add_edit: false,
        header: "",
        open_detail:false,
        open_review_list: false,
        open_select_innovation: false,
        open_select_expert: false,
        isEvadeCompany: "0",
        open_project_approval: false,
        projectName:'',
        open_innovation_award: false,
        open_review_standard: false,
        open_expert_detail: false,
        open_sms_template: false,
        open_innovation_detail: false,
        idCard: ''
      },
      requiredRules: {
        name: [
          { required: true, message: "分组名不能为空"}
        ],
      },
      formData: {
        id: '',
        reviewType: '',
        name: '',// 分组名
        note: '',
        subjectClassification: '',
        planName: "",
        innovationCategory: [],
        reviewMeetingDate: '',
      },
      baseLoading:false,
      dataLoading: false,
    }
  },
  watch: {
    'formData.id': {
      immediate: true,
      handler(val) {
        if(this.formData.id){
          this.teamInnovationGet();
          this.teamExpertGet();
        }
      }
    },
  },
  created() {
    this.dataLoading=true;
    this.getListReviewTeam();
    this.getIndexList();
  },
  methods: {
    onResetFP(){
      const confirmDia = this.$dialog.confirm({
        header: "系统提示",
        body: `是否重置已分配成果？`,
        theme: "warning",
        onConfirm: ({e}) => {
          confirmDia.update({
            confirmBtn: {
              loading: true,
            },
          })
          this.$api.wcx.review.reSetByTeamId(this.formData.id).then(response => {
            this.$message.success('重置成功')
            this.teamExpertGet();
            confirmDia.destroy();
          }).catch((e) => {
            confirmDia.update({
              confirmBtn: {
                loading: false,
              },
            })
            this.$message.error(e.toString());
          });
        },
      })

    },
    onFP(){
      const confirmDia = this.$dialog.confirm({
        header: "系统提示",
        body: `是否随机分配成果？`,
        theme: "warning",
        onConfirm: ({e}) => {
          confirmDia.update({
            confirmBtn: {
              loading: true,
            },
          })
          this.$api.wcx.review.extractByTeamId(this.formData.id).then(response => {
            this.$message.success('分配成功')
            this.teamExpertGet()
            confirmDia.destroy();
          }).catch((e) => {
            confirmDia.update({
              confirmBtn: {
                loading: false,
              },
            })
            this.$message.error(e.toString());
          });
        },
      })
    },
    getDuty(duty, profTit) {
      const newProfTit = filters.filterByDict(profTit, this.dict.type.prof_tit, null)
      return `${duty}/${newProfTit}`;
    },
    getIndexList() {
      return this.$api.wcx.review.indexList(this.queryParams).then(
        (res) => {
          this.dataOptions = res.rows.map(val=>({"label":val.name,"value":val.id}));
        }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    removeNode(node) {
      this.$api.wcx.review.teamDel(node.data.id).then(
        (res) => {
          this.getListReviewTeam();
          this.$message.success("删除成功");
        }
      ).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    getListReviewTeam() {
      this.$api.wcx.review.teamList().then((res) => {
        this.dataLoading = false
        this.TreeReviewTeamData = this.handleTree(res.data, "id");
      }).catch((e) => {
        this.dataLoading = false
        this.$message.error(e.toString());
      });
    },
    // 获取树形
    getTreeReviewTeam() {
      this.$api.wcx.review.teamTree().then((res) => {
        this.dataLoading=false
        this.TreeReviewTeamData = res.data;
      }).catch((e) => {
        this.dataLoading=false
        this.$message.error(e.toString());
      });
    },
    onTreeActive(value, context) {
      this.actived = [context.node.data.id]
      if (context.node.data.reviewMenuType === '2') {
        this.$api.wcx.review.teamGet(context.node.data.id).then((response) => {
          Object.assign(this.formData, response.data);
        }).catch((e) => {
          this.$message.error(e.toString());
        });
      } else {
        this.formData.id = null;
      }
    },
    // 本组申报成果列表
    teamInnovationGet() {
      this.$api.wcx.review.teamInnovationGet(this.formData.id).then((response) => {
        this.innovationList = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    // 查专家列表
    teamExpertGet() {
      this.$api.wcx.review.teamExpertGet(this.formData.id).then((response) => {
        this.expertList = response.data;
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
    selectInnovation() {
      if (!this.formData.id) {
        return this.$message.error('请选择分组')
      }
      this.dialog.open_select_innovation = true
    },
    selectExpert(type) {
      if (!this.formData.id) {
        return this.$message.error('请选择分组')
      }
      this.dialog.isEvadeCompany = type;
      this.dialog.open_select_expert = true
    },
    // 删除项目
    teamInnovationDel(id) {
      const confirmDia = this.$dialog.confirm({
        header: "系统提示",
        body: `是否确认删除？`,
        theme: "warning",
        onConfirm: ({e}) => {
          confirmDia.update({
            confirmBtn: {
              loading: true,
            },
          })
          this.$api.wcx.review.teamInnovationDel(id).then(res => {
            this.$message.success('删除成功')
            this.teamInnovationGet();
            confirmDia.destroy();
          }).catch((e) => {
            confirmDia.update({
              confirmBtn: {
                loading: false,
              },
            })
            this.$message.error(e.toString());
          });
        },
      })
    },
    // 删除专家
    teamExpertDel(id) {
      const confirmDia = this.$dialog.confirm({
        header: "系统提示",
        body: `是否确认删除？`,
        theme: "warning",
        onConfirm: ({e}) => {
          confirmDia.update({
            confirmBtn: {
              loading: true,
            },
          })
          this.$api.wcx.review.teamExpertDel(id).then(res => {
            this.$message.success('删除成功')
            this.teamExpertGet()
            confirmDia.destroy();
          }).catch((e) => {
            confirmDia.update({
              confirmBtn: {
                loading: false,
              },
            })
            this.$message.error(e.toString());
          });
        },
      })
    },
    changeActived(id) {
      this.actived = [id]
      this.$api.wcx.review.teamGet(id).then((response) => {
        Object.assign(this.formData, response.data);
      }).catch((e) => {
        this.$message.error(e.toString());
      });
    },
  }
}
</script>

<style scoped lang="less">
@import url("@/style/duty.less");
.op_groups {
  display: flex;

}
</style>
